﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SubmitBill.aspx.cs" Inherits="DelStorage_SubmitBill" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>正贸智能仓储物流管理系统</title>
    <link href="../css/css.css" rel="stylesheet" type="text/css" />
     <script type="text/javascript" src="../../JS/jquery-1.10.2.js"></script>
    <script src="../js/Validate.js"></script>
    <script src="../js/WdatePicker.js"></script>
    <style type="text/css">
        .find td {
            border-bottom: 1px solid #b5d6e6;
            border-right: 1px solid #b5d6e6;
            border-left: 1px solid #b5d6e6;
        }
        .auto-style2 {
            width: 170px;
            height: 30px;
        }
        .auto-style4 {
            height: 30px;
        }
        .auto-style5 {
            width: 80px;
            height: 30px;
        }
        .auto-style6 {
            width: 50px;
            height: 30px;
        }
        .auto-style7 {
            position: absolute;
            width: 120px;
            height: 22px;
            left: 1150px;
            top: 71px;
        }
    </style>
    <script type="text/javascript" language="javascript">
    <!--
    function SelectAllCheckBox() {

        var form = document.forms[0];
        for (i = 0; i < form.elements.length; i++) {
            if (form.elements[i].checked == false) {
                j = 0;
            }
            else {
                j = 1;
            }
        } if (j == 0) {
            for (i = 0; i < form.elements.length; i++) {
                form.elements[i].checked = true;
            }
        }
        else {
            for (i = 0; i < form.elements.length; i++) {
                form.elements[i].checked = false;
            }
        }
    }

    function fPOSDlg(URL, Target, form)  //
    {
        now = new Date();
        var rom;
        var rom1
        rom = Math.ceil(Math.random() * 10000);
        rom1 = now.getFullYear() + "" + now.getMonth() + "" + now.getDate() + "" + now.getHours() + "" + now.getMinutes() + "" + now.getSeconds() + "" + rom;

        showx = event.screenX - event.offsetX - 4; // + deltaX;
        showy = event.screenY - event.offsetY + 18; // + deltaY;
       // retval = window.showModalDialog(URL + "?radmom=" + rom1, "", "dialogWidth:600px; dialogHeight:450px; dialogLeft:" + showx + "px; dialogTop:" + showy + "px; status:no; directories:yes;help:no;scrollbars:no;Resizable=no; ");
        var retval = window.open(URL, "win2", "height=450px, width=600px, top=" + showy + ", left=" + showx + ",modal=yes,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no");

        if (retval != null) {
            var CompanyName = retval.split(",");

            //                document.form1.txtX01.value = CompanyName[0];       //获取凭证号
            document.form1.txtAA.value = CompanyName[1];           //入/出
            document.form1.txtStockNo.value = CompanyName[0];           //凭证号

        }
    }


    function fPopUpCalendarDlg(URL, Target, form)  //
    {
        now = new Date();
        var rom;
        var rom1
        rom = Math.ceil(Math.random() * 10000);
        rom1 = now.getFullYear() + "" + now.getMonth() + "" + now.getDate() + "" + now.getHours() + "" + now.getMinutes() + "" + now.getSeconds() + "" + rom;

        showx = event.screenX - event.offsetX - 4; // + deltaX;
        showy = event.screenY - event.offsetY + 18; // + deltaY;
        retval = window.showModalDialog(URL + "?radmom=" + rom1, "", "dialogWidth:605px; dialogHeight:350px; dialogLeft:" + showx + "px; dialogTop:" + showy + "px; status:no; directories:yes;help:no;scrollbars:no;Resizable=no; ");

        if (retval != null) {
            var Material = retval.split(",");
            document.forms(0).txtStorageNo.value = Material[1];           //单据号
        }
    }
  

    $(function () {
        $('#gvStock input[type=checkbox]').click(function () {
            if ($(this).attr('checked') == undefined || $(this).attr('checked') == false) {
                $(this).attr('checked', true).parent().parent().siblings('tr').find('input[type=checkbox]').attr('checked', false);
            }
            else {
                $(this).attr('checked', false);
            }
        });
    });
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td style="height: 30px">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td style="background-image: url(../images/tab_03.gif); background-repeat: repeat-x; width: 12px;">&nbsp;
                                </td>
                                <td style="background-image: url(../images/tab_05.gif); background-repeat: repeat-x; height: 30px;">
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td style="width: 46%; vertical-align: middle;">
                                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                    <tr>
                                                        <td style="width: 5%; vertical-align: middle;">
                                                            <img src="../images/tb.gif" width="16" height="16" />
                                                        </td>
                                                        <td style="width: 95%;">
                                                            <span>你当前的位置</span>：业务管理-单据确认
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                            <td width="54%"></td>
                                        </tr>
                                    </table>
                                </td>
                                <td width="16" style="background-image: url(../images/tab_07.gif); height: 30px;">&nbsp;
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid #b5d6e6;">
                            <tr>
                                <td style="background-image: url(../images/tab_12.gif); width: 8px;">&nbsp;
                                </td>
                                <td>
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="find">
                                        <tr>
                                            <td style="padding: 2px;">
                                                <table width="100%" cellspacing="0" cellpadding="0" style="border: 1px solid #b5d6e6; border-collapse: collapse;">
                                                    <tr>
                                                        <td align="right" style="width: 80px;">单据号：
                                                        </td>
                                                        <td style="padding-left: 2px; width: 170px;">
                                                            <asp:TextBox ID="txtStockNo" runat="server" Style="width: 140px; height: 14px; border: solid 1px #b5d6e6; font-size: 9pt;"></asp:TextBox>
                                                            &nbsp;
                                                        </td>
                                                        <td align="right" style="width: 80px;">单据选择：
                                                        </td>
                                                        <td style="padding-left: 2px; width: 50px;">
                                                            <asp:DropDownList ID="ddlS" runat="server" Style="width: 120px; height: 18px; border: solid 1px #b5d6e6; font-size: 9pt;">
                                                                <asp:ListItem Value="0">入库单</asp:ListItem>
                                                                <asp:ListItem Value="1">出库单</asp:ListItem>
                                                            </asp:DropDownList>
                                                        </td>
                                                        <td style="padding-left: 2px;" align="right">处理状态：
                                                        </td>
                                                        <td style="padding-left: 2px;">
                                                            <asp:DropDownList ID="cobDueState" runat="server" Style="width: 120px; height: 18px; border: solid 1px #b5d6e6; font-size: 9pt;">
                                                                <asp:ListItem Value="-1">—选择—</asp:ListItem>
                                                                <asp:ListItem Value="0">未完成</asp:ListItem>
                                                                <asp:ListItem Value="1">已完成</asp:ListItem>
                                                            </asp:DropDownList>
                                                        </td>
                                                       <td style="padding-left: 5px;" colspan="2">
                                                            <asp:Label ID="lbMsg" runat="server" Style="width: 150px; height: 14px; border: solid 0px #b5d6e6; font-size: 9pt;"
                                                                ForeColor="Red"></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right" class="auto-style5">开始日期：
                                                        </td>
                                                        <td style="padding-left: 2px; " class="auto-style2">
                                                            <asp:TextBox ID="txtDateS" runat="server" Style="width: 80px; height: 14px; border: solid 1px #b5d6e6; font-size: 9pt;"
                                                                onfocus="new WdatePicker(this)"></asp:TextBox>
                                                        </td>
                                                        <td align="right" class="auto-style5">结束日期
                                                        </td>
                                                        <td style="padding-left: 2px; " class="auto-style6">
                                                            <asp:TextBox ID="txtDateE" runat="server" Style="width: 80px; height: 14px; border: solid 1px #b5d6e6; font-size: 9pt;"
                                                                onfocus="new WdatePicker(this)"></asp:TextBox>
                                                        </td>
                                                          <td style="padding-left: 2px;" align="right" class="auto-style5">同步MES：
                                                        </td>
                                                        <td style="padding-left: 2px;" class="auto-style6">
                                                            <asp:DropDownList ID="ddlSyncMes" runat="server" Style="width: 120px; height: 18px; border: solid 1px #b5d6e6; font-size: 9pt;">
                                                                <asp:ListItem Value="-1">—选择—</asp:ListItem>
                                                                <asp:ListItem Value="0">未同步</asp:ListItem>
                                                                <asp:ListItem Value="1">已同步</asp:ListItem>
                                                            </asp:DropDownList>
                                                        </td>
                                                         <td colspan="2" style="text-align:center;padding-top:6px;" class="auto-style4" >
                                                            <asp:ImageButton ID="ibtnSearch" runat="server" ImageUrl="~/Images/btn/btn_Search.gif"
                                                                OnClick="ibtnSearch_Click" />
                                                            &nbsp;
                                                        <asp:ImageButton ID="ibtnSubmit" runat="server" ImageUrl="~/Images/btn/btnListquren.gif"
                                                            OnClick="ibtnSubmit_Click" Style="height: 20px" />
                                                            &nbsp;
                                                         <asp:ImageButton ID="ibtnCancel" runat="server" ImageUrl="~/Images/btn/btn_CancelConfir.gif"
                                                             OnClick="ibtnCancel_Click" Style="height: 20px" />
                                                            &nbsp;
<%--                                                        <asp:ImageButton ID="ibtnDelete" runat="server" OnClick="ibtnDelete_Click" ImageUrl="~/Images/btn/btn_zuofei.gif" />--%>
                                                        <asp:Button Style="border-radius: 2px;font-weight:800;font-size: 12px;border-color: #B5D6E6; display: inline-block;" ID="ibt_UserComplete" runat="server" Text="线下人工拣选完成" OnClientClick="return confirm('确定此单据已经人工拣选出库完成？')" OnClick="ibt_UserComplete_Click" />
                                                        </td>
                                                    </tr>
                                                   
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="padding: 2px;" valign="top">
                                                <div style="margin-left: 0px; margin-top: 3px; width: 99.5%; height: 540px; overflow: auto; overflow-x: auto; overflow-y: auto;">
                                                    <asp:GridView ID="gvStock" runat="server" AutoGenerateColumns="False" Width="100%"
                                                        AllowPaging="true" PageSize="20" OnPageIndexChanging="gvStock_PageIndexChanging"
                                                        OnSelectedIndexChanged="gvStock_SelectedIndexChanged"
                                                        DataKeyNames="StockNo" OnRowDataBound="gvStock_RowDataBound">
                                                        <Columns>
                                                            <asp:TemplateField>
                                                                <HeaderTemplate>
<%--                                                                    <input id="hchkSelect" type="checkbox" onclick="SelectAllCheckBox()" />--%>
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <asp:CheckBox ID="chkSelect" runat="server" />
                                                                </ItemTemplate>
                                                                <ItemStyle Width="5%" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="编号">
                                                                <ItemStyle HorizontalAlign="Center" />
                                                                <ItemTemplate>
                                                                    <asp:Label ID="LabNumber" runat="server" Text="<%#Container.DataItemIndex+1%>"></asp:Label>
                                                                </ItemTemplate>
                                                                <ItemStyle Width="10%" />
                                                            </asp:TemplateField>
                                                            <asp:BoundField DataField="StockNo" HeaderText="单据号">
                                                                <ItemStyle Width="30%" />
                                                            </asp:BoundField>
                                                            <asp:BoundField DataField="AA" HeaderText="入\出">
                                                                <ItemStyle Width="10%" />
                                                            </asp:BoundField>
                                                               <asp:BoundField DataField="Bill_Status" HeaderText="状态">
                                                                <ItemStyle Width="5%" />
                                                            </asp:BoundField>
                                                             <asp:TemplateField HeaderText="同步MES">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="lbMesStatus" runat="server" Text='<%# Bind("SyncStatus") %>'></asp:Label>
                                                                        </ItemTemplate>
                                                                       <ItemStyle Width="6%" />
                                                                    </asp:TemplateField>
                                                             <asp:BoundField DataField="Contents" HeaderText="备注" DataFormatString="{0:yyyy-MM-dd}">
                                                                <ItemStyle Width="10%" />
                                                            </asp:BoundField>
                                                            <asp:BoundField DataField="CDT" HeaderText="创建时间" DataFormatString="{0:yyyy-MM-dd}">
                                                                <ItemStyle Width="10%" />
                                                            </asp:BoundField>
                                                            <asp:TemplateField HeaderText="操作">
                                                                <ItemTemplate>
                                                                    <asp:LinkButton ID="lbtn_StockNo" runat="server" Text="查看明细" ForeColor="Blue" CommandArgument='<%# Eval("StockNo") +"|" +  Eval("AA") + "|" + Eval("B01")%> '></asp:LinkButton>

                                                                    &nbsp;&nbsp;<asp:LinkButton ID="lbSyncMes" runat="server" CommandArgument='<%# Eval("StockNo") + "|" + Eval("AA") +"|"+ Eval("Bill_Status")+"|"+Eval("Small_BillType")%> ' ForeColor="Blue"  OnClientClick="return confirm('确定同步单据到MES系统吗？')" OnClick="lbSyncMes_Click" Text="同步MES"></asp:LinkButton>

                                                                </ItemTemplate>
                                                                <ItemStyle Width="20%" />
                                                            </asp:TemplateField>

                                                        </Columns>
                                                        <HeaderStyle HorizontalAlign="Center" CssClass="gvHeader" />
                                                        <RowStyle CssClass="gvRow" HorizontalAlign="Center" />
                                                        <PagerSettings Mode="Numeric"></PagerSettings>
                                                    </asp:GridView>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="padding: 2px" valign="top">
                                                <div style="margin-left: 0px; margin-top: 3px; width: 99.5%; height: 180px; overflow: auto; overflow-x: auto; overflow-y: auto;">
                                                    <asp:GridView ID="gv" runat="server" AutoGenerateColumns="False" Width="100%" BorderWidth="1px"
                                                        BorderColor="#B5D6E6" CellPadding="0" OnRowDataBound="gv_RowDataBound" AllowPaging="false"
                                                        AllowSorting="True">
                                                        <Columns>
                                                            <asp:BoundField DataField="StockNo" HeaderText="单据号">
                                                                <ItemStyle Width="65px" />
                                                            </asp:BoundField>
                                                            <asp:BoundField DataField="Mat_Code" HeaderText="物料编码">
                                                                <ItemStyle Width="60px" />
                                                            </asp:BoundField>
                                                            <asp:BoundField DataField="Num" HeaderText="计划数量">
                                                                <ItemStyle Width="50px" />
                                                            </asp:BoundField>
                                                            <asp:BoundField DataField="Act_Num" HeaderText="实际数量">
                                                                <ItemStyle Width="50px" />
                                                            </asp:BoundField>
                                                            <%--<asp:BoundField DataField="S03" HeaderText="批号">
                                                        <ItemStyle Width="50px" />
                                                    </asp:BoundField>
    
                                                    <asp:BoundField DataField="S05" HeaderText="目的仓库">
                                                        <ItemStyle Width="50px" />
                                                    </asp:BoundField>
                                 
                                                    <asp:BoundField DataField="S04" HeaderText="物资用途">
                                                        <ItemStyle Width="50px" />
                                                    </asp:BoundField>--%>
                                                        </Columns>
                                                        <HeaderStyle HorizontalAlign="Center" CssClass="gvHeader" />
                                                        <RowStyle CssClass="gvRow" HorizontalAlign="Center" />
                                                        <PagerSettings Mode="Numeric"></PagerSettings>
                                                    </asp:GridView>
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                                <td style="background-image: url(../images/tab_15.gif); width: 8px;">&nbsp;
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td style="background-image: url(../images/tab_19.gif); height: 35px;">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td style="width: 12px; height: 35px;">
                                    <img src="../images/tab_18.gif" width="12" height="35" />
                                </td>
                                <td>&nbsp;
                                </td>
                                <td width="16">
                                    <img src="../images/tab_20.gif" width="16" height="35" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <asp:HiddenField ID="hidden" runat="server" />
        </div>
    </form>
</body>
</html>
